cmake_minimum_required(VERSION 3.10)

set(DIR ${FL_CORE_DIR}/test)
set(LIBS flashlight ${CMAKE_DL_LIBS})
build_test(SRC ${DIR}/autograd/AutogradTest.cpp LIBS ${LIBS})
build_test(SRC ${DIR}/common/DevicePtrTest.cpp LIBS ${LIBS})
build_test(SRC ${DIR}/common/DynamicBenchmarkTest.cpp LIBS ${LIBS})
build_test(SRC ${DIR}/common/HistogramTest.cpp LIBS ${LIBS})
build_test(SRC ${DIR}/common/LoggingTest.cpp LIBS ${LIBS})
build_test(SRC ${DIR}/common/SerializationTest.cpp LIBS ${LIBS})
build_test(SRC ${DIR}/optim/OptimTest.cpp LIBS ${LIBS})
build_test(SRC ${DIR}/memory/CachingMemoryManagerTest.cpp LIBS ${LIBS})
build_test(SRC ${DIR}/memory/MemoryFrameworkTest.cpp LIBS ${LIBS})
build_test(SRC ${DIR}/memory/MemoryInitTest.cpp LIBS ${LIBS})
build_test(SRC ${DIR}/nn/ModuleTest.cpp LIBS ${LIBS})
build_test(SRC ${DIR}/nn/NNSerializationTest.cpp LIBS ${LIBS})
build_test(SRC ${DIR}/nn/NNUtilsTest.cpp LIBS ${LIBS})
build_test(SRC ${DIR}/dataset/DatasetTest.cpp LIBS ${LIBS})
build_test(SRC ${DIR}/dataset/DatasetUtilsTest.cpp LIBS ${LIBS})
build_test(SRC ${DIR}/meter/MeterTest.cpp LIBS ${LIBS})
if (FL_BUILD_DISTRIBUTED)
  build_test(SRC ${DIR}/distributed/AllReduceTest.cpp LIBS ${LIBS})
endif ()
if (FL_BUILD_CONTRIB)
  build_test(SRC ${DIR}/contrib/modules/ContribModuleTest.cpp LIBS ${LIBS})
  build_test(SRC ${DIR}/contrib/modules/ContribSerializationTest.cpp LIBS ${LIBS})
endif ()
